package components
{
	import UIFree.abox.uif_abox;
	import UIFree.abox.uif_moduleBox;
	import UIFree.uif_component;
	
	import flash.geom.Rectangle;
	
	public class c_moduleBoxWindow extends c_window {
		protected var _tabBox: uif_moduleBox;
		public function c_moduleBoxWindow(parent:uif_component, a_data: Object, a_previewURL: String, 
										  a_selectEvent: Object, a_rows: int=0, 
										  awidth:int=0, aheight:int=0, a_title:String='', modal:Boolean=false, canClose:int=2, a_styleClass: Object=null) {
			super(parent, awidth, aheight, a_title, modal, canClose, a_styleClass);
			createComponent(dataBoxRect, a_data, a_previewURL, a_selectEvent, a_rows);
		}
		
		protected function createComponent(a_rect: Rectangle, a_data: Object, a_previewURL: String, a_selectEvent: Object, a_rows: int): void {
			_tabBox = new uif_moduleBox(this, a_data, a_previewURL, a_selectEvent, a_rect.x, a_rect.y, 
								a_rect.width, a_rect.height, 0, a_rows, style.tabBox, false); 
		}
		
		protected function get dataBoxRect(): Rectangle {
			var rect: Rectangle = clientBounds;
			rect.inflate(0, -5);
			return rect;
		}
		
		public function get tabBox(): uif_moduleBox {
			return _tabBox;
		}
	}
}